package com.gongpingjialoan.activity.sell;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.text.TextUtils;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;

import com.gongpingjialoan.R;
import com.gongpingjialoan.activity.main.BaseActivity;

/*
 *@author zhanglong
 *Email:1269521147@qq.com
 */
public class ExtraMsgActivity extends BaseActivity {

    private Button confirmBtn;

    private EditText msgEditText;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        // TODO Auto-generated method stub
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_extra_msg);
        setTitle("车主附言");

        msgEditText = (EditText) findViewById(R.id.et_msg);
        String message = getIntent().getStringExtra("message");
        if(!TextUtils.isEmpty(message)){
        	msgEditText.setText(message);
        }
        confirmBtn = (Button) findViewById(R.id.btn_confirm);
        confirmBtn.setOnClickListener(new View.OnClickListener() {

            @Override
            public void onClick(View v) {
                // TODO Auto-generated method stub
                String str = msgEditText.getText().toString();
                Intent it = new Intent(ExtraMsgActivity.this, WantSellCarActivity.class);
                it.putExtra("msg", str);
                setResult(Activity.RESULT_OK, it);
                ExtraMsgActivity.this.finish();
            }
        });

    }
}
